package com.hspedu.Enumeration_;

public class Enumeration01 {
    public static void main(String[] args) {
        Season autumn = Season.AUTUMN;
        System.out.println(autumn.name());
        System.out.println(autumn.ordinal());
        Season[] seasons = Season.values();
        for(Season season:seasons){
            System.out.println(season);
        }

    }
}

enum Season{

    SPRING("spring","warm"),
    Winter("winter","cold"),
    SUMMER("summer","hot"),
    AUTUMN("autumn","cool");
    private String name;
    private String desc;


    private Season(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    @Override
    public String toString() {
        return "Season{" +
                "name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }
}